import numpy as np

def read_npy_file(file_path):
    """
    读取 .npy 文件并打印内容，支持加载对象数组
    :param file_path: .npy 文件的路径
    """
    try:
        # 允许加载对象数组
        data = np.load(file_path, allow_pickle=True)
        print("文件内容:")
        print(data)
    except Exception as e:
        print(f"读取文件时出错: {e}")

if __name__ == "__main__":
    file_path = input("请输入 .npy 文件的路径: ")
    read_npy_file(file_path)
#C:\\Users\\Lu\\Desktop\\大三秋冬\\BSP\\Project\\data\\processed\\test_data\\sample_101.npy
